using System;
using System.Management;
using System.Windows.Forms;
using FlickrShots.Framework;
using FlickrShots.GUI.Forms;

namespace FlickrShots
{
	public class FlickrShotsMain
	{
        [STAThread]
        public static void Main() 
        {
            ChangerForm mainForm = new ChangerForm();
            Preferences.Instance.LoadDefaultPreferences();
            Application.Run(mainForm);
        }

        public int CountRunningInstances()
        {
            string wql = "select count(*) from CIM_Process where name='{0}'"; 
            ManagementObjectSearcher searcher = new ManagementObjectSearcher(wql);

            return Int32.Parse(searcher.Get().GetEnumerator().Current.GetText(new TextFormat()));
        }
	}
}
